import 'package:flutter/material.dart';

class ErrorView extends StatelessWidget {
  const ErrorView({super.key, this.retryAction});

  final VoidCallback? retryAction;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Icon(
            Icons.error_outline,
            size: 32,
          ),
          const SizedBox(height: 12),
          GestureDetector(
            onTap: retryAction,
            child: Text(
              '网络错误，点击重试',
              style: TextStyle(fontSize: 14),
            ),
          ),
        ],
      ),
    );
  }
}
